package com.hmy.infrastructure.api.client.signature;


import com.hmy.ccp.common.result.FeignResult;
import com.hmy.ccp.common.result.Results;
import com.hmy.infrastructure.api.bo.request.signature.*;
import com.hmy.infrastructure.api.bo.response.signature.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient("hmy-ccp-infrastructure")
public interface SignatureClient {
    @PostMapping("/feign/signature/getUploadUrl")
    FeignResult<GetUploadUrlApiResponse> getUploadUrl(@RequestBody GetUploadUrlApiRequest getUploadUrlRequest);

    /**
     * 创建流程
     * @param createSignatureProcessRequest
     * @return
     */
    @PostMapping("/feign/signature/create")
    FeignResult<CreateSignatureProcessApiResponse> create(@RequestBody CreateSignatureProcessApiRequest createSignatureProcessRequest);
    /**
     * 创建合同，通用接口
     * @param createContractApiRequest
     * @return
     */
    @PostMapping("/feign/signature/createContract")
    FeignResult<CreateContractApiResponse> createContract(@RequestBody CreateContractApiRequest createContractApiRequest);

    /**
     * 签约模板数据填充
     * @param fieldFillRequest
     * @return
     */
    @PostMapping("/feign/signature/signTemplateFieldFill")
    FeignResult<SignTemplateFieldFillApiResponse> signTemplateFieldFill(@RequestBody SignTemplateFieldFillApiRequest fieldFillRequest);

    /**
     * 文件模板数据填充
     * @param fileTemplateFieldFillRequest
     * @return
     */
    @PostMapping("/feign/signature/fileTemplateFieldFill")
    FeignResult<FileTemplateFieldFillApiResponse> fileTemplateFieldFill(@RequestBody FileTemplateFieldFillApiRequest fileTemplateFieldFillRequest);

    /**
     * 开始签约流程
     * @param startSignatureProcessRequest
     * @return
     */
    @PostMapping("/feign/signature/start")
    FeignResult<StartSignatureProcessApiResponse> start(@RequestBody StartSignatureProcessApiRequest startSignatureProcessRequest);

    /**
     * 获取签署完成后的文件链接
     * @param getSignFileUrlRequest
     * @return
     */
    @PostMapping("/feign/signature/getSignFileUrl")
    FeignResult<GetSignFileUrlApiResponse> getSignFileUrl(@RequestBody GetSignFileUrlApiRequest getSignFileUrlRequest);

    /**
     * 获取签约链接
     * @param getSignTaskUrlRequest
     * @return
     */
    @PostMapping("/feign/signature/getSignTaskUrl")
    FeignResult<GetSignTaskUrlApiResponse> getSignTaskUrl(@RequestBody GetSignTaskUrlApiRequest getSignTaskUrlRequest);

    @PostMapping("/feign/signature/createContractByFile")
    FeignResult<CreateContractByFileApiResponse> createContractByFile(@RequestBody CreateContractByFileApiRequest createContractRequest);


    @PostMapping("/feign/signature/cancel")
    FeignResult<SignTaskCancelApiResponse> cancel(@RequestBody SignTaskCancelApiRequest request);

}
